#include <fstream>
#include <iostream>
#include <cstdlib>

using namespace std;

#define ASSERT(TST, MSG) \
	if (! (TST)) { \
		cerr << __FILE__ "(" << __LINE__ << "): Assertion failed " \
		#TST << " " << (MSG) << endl; \
		return 0; \
	}

int main(int argc, char* argv[]) {
	ASSERT(argc == 3, "enter input file name and word");
	
	string word;
	unsigned int count = 0;
	ifstream file(argv[1]);
	while(file >> word) {
		if(word == argv[2])
		       ++count;
	}


	cout << "there are " << count << " occurences of word \"" << argv[2] << "\" in the file\n";
	return 0;
}	
	
